package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Visit;
import com.zzyl.vo.VisitVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface VisitMapper {

    int update(Visit visit);

    int deleteById(Long id);

    Visit findById(Long id);

    List<Visit> findAll(@Param("mobile") String mobile, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
@Insert("insert into visit(name,time,visitor,status,create_time,update_time,remark,mobile,type,create_by,update_by) values(#{name},#{time},#{visitor},#{status},#{createTime},#{updateTime},#{remark},#{mobile},#{type},#{createBy},#{updateBy})")
    void create(Visit visit);

    Page<VisitVo> findByPage(String name, String phone, Integer status, Integer type, LocalDateTime startTime, LocalDateTime endTime);
}
